/* films1.c -- using an array of structures */
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "queue/queue.h"

int main(void)
{
	Queue queue;
	Item item = {0};

	InitQueue(&queue);

    puts("Enter your name, q to quit:");
    while (scanf("%s", item.name) > 0 
		&& item.name[0] != 'q')
    {
		item.arrive = time(NULL);
       
		QueueAdd(&queue, item);
        puts("Enter your next name, q to quit):");
    }

	printf("count:%d\n", QueueItems(&queue));

	while(!QueueIsEmpty(&queue)){
		
        QueueDelete(&queue, &item);
		printf("arrive:%d\n", item.arrive);
    }

	
	printf("Bye!\n");
 
   
    return 0;
}

